<html>
<head><meta charset="utf-8"><title>rustdoc calls `for_each_relevant_impl` a lot · t-compiler/performance · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/index.html">t-compiler/performance</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html">rustdoc calls `for_each_relevant_impl` a lot</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="215672877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/215672877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#215672877">(Nov 05 2020 at 05:33)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/78761#issuecomment-722150923">https://github.com/rust-lang/rust/issues/78761#issuecomment-722150923</a></p>
<p>any ideas how to make this faster? <span class="user-mention" data-user-id="119009">@eddyb</span> blanket impls are like <code>impl&lt;T&gt; MyTrait for T</code>, right? is there any way to speed that up other than by looking at all traits and impls?</p>



<a name="215672946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/215672946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#215672946">(Nov 05 2020 at 05:35)</a>:</h4>
<p>the other thing that's really weird is that <code>get_blanket_impls</code> takes 2-3x as long for intra-doc links as for <code>clean</code>, but it should be doing exactly the same thing</p>



<a name="215672949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/215672949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#215672949">(Nov 05 2020 at 05:35)</a>:</h4>
<p>maybe it's just calling it more</p>



<a name="215675267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/215675267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#215675267">(Nov 05 2020 at 06:33)</a>:</h4>
<p>ok yes I found the issue was that rustdoc isn't short-circuiting when it could be</p>



<a name="215675308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/215675308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#215675308">(Nov 05 2020 at 06:34)</a>:</h4>
<p>probably there are more isues that will crop up after</p>



<a name="218334345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218334345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218334345">(Nov 30 2020 at 19:34)</a>:</h4>
<p>this is not entirely fixed but is <em>astoundingly</em> better after <a href="https://github.com/rust-lang/rust/pull/77700#issuecomment-735995025">https://github.com/rust-lang/rust/pull/77700#issuecomment-735995025</a></p>



<a name="218337761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218337761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218337761">(Nov 30 2020 at 20:01)</a>:</h4>
<p>would love to have thoughts on <a href="https://github.com/rust-lang/rustc-perf/pull/802">https://github.com/rust-lang/rustc-perf/pull/802</a></p>



<a name="218338083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338083">(Nov 30 2020 at 20:03)</a>:</h4>
<p>If it's not a huge time sink it seems reasonable</p>



<a name="218338177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338177">(Nov 30 2020 at 20:04)</a>:</h4>
<p>let me bench it locally</p>



<a name="218338194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338194">(Nov 30 2020 at 20:04)</a>:</h4>
<p>I am not sure about the cargo config with a custom target though</p>



<a name="218338216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338216">(Nov 30 2020 at 20:04)</a>:</h4>
<p>I guess we can prebuild std for that target too</p>



<a name="218338219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338219">(Nov 30 2020 at 20:04)</a>:</h4>
<p>we can probably remove that and still get good benchmarks</p>



<a name="218338228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338228">(Nov 30 2020 at 20:04)</a>:</h4>
<p>IIRC it's not actually needed</p>



<a name="218338230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338230">(Nov 30 2020 at 20:04)</a>:</h4>
<p>well, that's annoying, we removed that support</p>



<a name="218338244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338244">(Nov 30 2020 at 20:04)</a>:</h4>
<p>ok, if we can drop the target then it should work</p>



<a name="218338267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338267">(Nov 30 2020 at 20:04)</a>:</h4>
<p>I imagine CI might not pass with the custom target, not sure what we use for that right now</p>



<a name="218338302"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338302" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338302">(Nov 30 2020 at 20:05)</a>:</h4>
<p>oh it does need custom features, how do I add those?</p>



<a name="218338330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338330">(Nov 30 2020 at 20:05)</a>:</h4>
<p>I've been testing with <code>--features stm32h742</code></p>



<a name="218338368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338368">(Nov 30 2020 at 20:05)</a>:</h4>
<p>I guess I could change the code to turn it on by default? Are these benchmarks ever updated once added?</p>



<a name="218338646"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338646" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338646">(Nov 30 2020 at 20:08)</a>:</h4>
<p>There's support for perf-config.json</p>



<a name="218338694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338694">(Nov 30 2020 at 20:08)</a>:</h4>
<p>They are not updated unless breakage occurs</p>



<a name="218338722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338722">(Nov 30 2020 at 20:08)</a>:</h4>
<p>ok, I could add it to cargo_opts</p>



<a name="218338748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218338748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218338748">(Nov 30 2020 at 20:08)</a>:</h4>
<p>yep that should work</p>



<a name="218339344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218339344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218339344">(Nov 30 2020 at 20:13)</a>:</h4>
<p>lol this takes so much memory I'm having trouble running it locally <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="218339392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218339392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218339392">(Nov 30 2020 at 20:14)</a>:</h4>
<p>it keeps getting OOM killed</p>



<a name="218339554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218339554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218339554">(Nov 30 2020 at 20:15)</a>:</h4>
<p>is there a way to get more info about this error? The <code>/tmp</code> file it mentiosn doesn't exist.</p>
<div class="codehilite"><pre><span></span><code>Benchmarking stm32 for triple x86_64-unknown-linux-gnu
1 benchmark remaining
Preparing stm32h7xx-hal
Running stm32h7xx-hal: Check + [Full]
collector error: Failed to benchmark &#39;stm32h7xx-hal&#39;, recorded: touching &quot;src/cargo/lib.rs&quot; in &quot;/tmp/.tmpEsclMn&quot;
collection took 163.282169148s with 1 failed benchmarks
collector error: 1 benchmarks failed
</code></pre></div>



<a name="218339663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218339663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218339663">(Nov 30 2020 at 20:16)</a>:</h4>
<p>It's a directory</p>



<a name="218339680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218339680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218339680">(Nov 30 2020 at 20:16)</a>:</h4>
<p>Try running with RUST_LOG=trace or so?</p>



<a name="218339713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218339713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218339713">(Nov 30 2020 at 20:16)</a>:</h4>
<p>(well, it should be a tmpdir)</p>



<a name="218339765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218339765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218339765">(Nov 30 2020 at 20:17)</a>:</h4>
<p><code>ls: cannot access '/tmp/.tmpEsclMn': No such file or directory</code></p>



<a name="218339770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218339770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218339770">(Nov 30 2020 at 20:17)</a>:</h4>
<p>I'll try RUST_LOG</p>



<a name="218339791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218339791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218339791">(Nov 30 2020 at 20:17)</a>:</h4>
<p>ok, in a meeting can help debug later</p>



<a name="218339816"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218339816" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218339816">(Nov 30 2020 at 20:17)</a>:</h4>
<p>yeah, this isn't urgent</p>



<a name="218340043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218340043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218340043">(Nov 30 2020 at 20:19)</a>:</h4>
<p>oh lol I set <code>touch_file</code> to <code>src/cargo/lib.rs</code></p>



<a name="218340057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218340057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218340057">(Nov 30 2020 at 20:19)</a>:</h4>
<p>which of course fails because the file doesn't exist</p>



<a name="218364848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218364848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218364848">(Dec 01 2020 at 00:11)</a>:</h4>
<p>hmm, now it's failing with 'non-wrapped rustc'</p>
<div class="codehilite"><pre><span></span><code>    Checking typenum v1.12.0
&quot;/home/joshua/.local/lib/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc&quot; [&quot;--crate-name&quot;, &quot;typenum&quot;, &quot;/home/joshua/.local/lib/cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.12.0/src/lib.rs&quot;, &quot;--error-format=json&quot;, &quot;--json=diagnostic-rendered-ansi&quot;, &quot;--crate-type&quot;, &quot;lib&quot;, &quot;--emit=dep-info,metadata&quot;, &quot;-C&quot;, &quot;embed-bitcode=no&quot;, &quot;-C&quot;, &quot;codegen-units=1&quot;, &quot;-C&quot;, &quot;debuginfo=2&quot;, &quot;-C&quot;, &quot;metadata=55abf5df980f67b0&quot;, &quot;-C&quot;, &quot;extra-filename=-55abf5df980f67b0&quot;, &quot;--out-dir&quot;, &quot;/tmp/.tmpKb7nkT/target/debug/deps&quot;, &quot;-L&quot;, &quot;dependency=/tmp/.tmpKb7nkT/target/debug/deps&quot;, &quot;--cap-lints&quot;, &quot;allow&quot;, &quot;-C&quot;, &quot;link-arg=-fuse-ld=lld&quot;, &quot;-Adeprecated&quot;, &quot;-Aunknown-lints&quot;]
exiting -- non-wrapped rustc
error: could not compile `typenum`

To learn more, run the command again with --verbose.
collector error: Failed to benchmark &#39;stm32h7xx-hal&#39;, recorded: expected success, got exit code: 101
</code></pre></div>



<a name="218364860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218364860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218364860">(Dec 01 2020 at 00:11)</a>:</h4>
<p>I remember this working a while ago :/</p>



<a name="218365196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218365196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218365196">(Dec 01 2020 at 00:14)</a>:</h4>
<p>hmm, this does work for other benchmarks though</p>



<a name="218365401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218365401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218365401">(Dec 01 2020 at 00:16)</a>:</h4>
<p>do I need to get rid of all the dependencies or something?</p>



<a name="218365472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218365472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218365472">(Dec 01 2020 at 00:17)</a>:</h4>
<p><code>clap</code> seems to have dependencies so I wouldn't expect that to be it</p>



<a name="218366394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218366394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218366394">(Dec 01 2020 at 00:28)</a>:</h4>
<p>this is <em>really</em> strange, <code>EXPECT_ONLY_WRAPPED_RUSTC</code> and <code>--wrap-rustc-with</code> are set in the same place, but this command line doesn't show <code>--wrap-rustc-with</code></p>



<a name="218366441"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218366441" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218366441">(Dec 01 2020 at 00:28)</a>:</h4>
<p>maybe rustc is calling itself recursively or something ??</p>



<a name="218370017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370017">(Dec 01 2020 at 01:19)</a>:</h4>
<p>ok, so I <em>think</em> what's going on is that <code>cargo rustc</code> only passes through the arguments to the last invocation of rustc</p>



<a name="218370028"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370028" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370028">(Dec 01 2020 at 01:19)</a>:</h4>
<p>but the environment variable EXPECT_ONLY_WRAPPED_RUSTC is set for each</p>



<a name="218370046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370046">(Dec 01 2020 at 01:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> is it ok if I just don't set that variable? I don't know a way to set env variables for only one invocation of rustc while still going through cargo</p>



<a name="218370130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370130">(Dec 01 2020 at 01:20)</a>:</h4>
<p>What are you trying to do?</p>



<a name="218370143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370143">(Dec 01 2020 at 01:21)</a>:</h4>
<p>compile <code>stm32</code> as a benchmark</p>



<a name="218370155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370155">(Dec 01 2020 at 01:21)</a>:</h4>
<p>but apparently some of the dependencies are getting rebuilt</p>



<a name="218370166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370166">(Dec 01 2020 at 01:21)</a>:</h4>
<p>and rustc-fake doesn't know what to do so it exits with an error</p>



<a name="218370167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370167">(Dec 01 2020 at 01:21)</a>:</h4>
<p>Right, you need to figure out why</p>



<a name="218370182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370182">(Dec 01 2020 at 01:22)</a>:</h4>
<p>hmm, this seems like a cargo question</p>



<a name="218370239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370239">(Dec 01 2020 at 01:22)</a>:</h4>
<p>There's the fingerprint log that CI uses and it should tell you enough</p>



<a name="218370262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370262">(Dec 01 2020 at 01:23)</a>:</h4>
<p>(you can also set it locally)</p>



<a name="218370270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370270">(Dec 01 2020 at 01:23)</a>:</h4>
<p>yeah this has some local changes</p>



<a name="218370331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370331">(Dec 01 2020 at 01:24)</a>:</h4>
<p>I agree that we should add this kind of benchmark, though so I will make time to take a look over the next week or so</p>



<a name="218370352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370352">(Dec 01 2020 at 01:24)</a>:</h4>
<p>I'll push my local changes tonight so you don't have to figure them out again</p>



<a name="218370380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370380">(Dec 01 2020 at 01:25)</a>:</h4>
<p>It's likely a matter of patching a build script or something</p>



<a name="218370717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370717">(Dec 01 2020 at 01:30)</a>:</h4>
<p>ok I found the issue, it was running <code>touch</code> on the output of a build script</p>
<div class="codehilite"><pre><span></span><code>./target/debug/build/typenum-39c640dcd10f7ddf/out/op.rs
./target/debug/build/typenum-39c640dcd10f7ddf/out/consts.rs
./target/debug/build/typenum-39c640dcd10f7ddf/out/tests.rs
</code></pre></div>



<a name="218370734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370734">(Dec 01 2020 at 01:31)</a>:</h4>
<p>Is there a way to tell <code>collector</code> 'touch all rust files not in <code>target/</code>'?</p>



<a name="218370817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370817">(Dec 01 2020 at 01:32)</a>:</h4>
<p>maybe I'll just patch it to always do that</p>



<a name="218370960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218370960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218370960">(Dec 01 2020 at 01:34)</a>:</h4>
<p>wow <code>find</code> has such ugly syntax</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gh">diff --git a/collector/src/execute.rs b/collector/src/execute.rs</span>
<span class="gh">index ccde0eb2..414e2df4 100644</span>
<span class="gd">--- a/collector/src/execute.rs</span>
<span class="gi">+++ b/collector/src/execute.rs</span>
<span class="gu">@@ -52,8 +52,9 @@ fn touch(root: &amp;Path, path: &amp;Path) -&gt; anyhow::Result&lt;()&gt; {</span>

 fn touch_all(path: &amp;Path) -&gt; anyhow::Result&lt;()&gt; {
     let mut cmd = Command::new("bash");
<span class="gi">+    // Don't touch files in `target/`, since they're likely generated by build scripts and might be from a dependency.</span>
     cmd.current_dir(path)
<span class="gd">-        .args(&amp;["-c", "find . -name '*.rs' | xargs touch"]);</span>
<span class="gi">+        .args(&amp;["-c", "find . -path ./target -prune -false -o -name '*.rs' | xargs touch"]);</span>
     command_output(&amp;mut cmd).with_context(|| format!("touching all .rs in {:?}", path))?;
     // We also delete the cmake caches to avoid errors when moving directories around.
     // This might be a bit slower but at least things build
</code></pre></div>



<a name="218371340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218371340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218371340">(Dec 01 2020 at 01:41)</a>:</h4>
<p>yay it's working <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> just needed a couple more patches to stm32</p>



<a name="218374794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/218374794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#218374794">(Dec 01 2020 at 02:46)</a>:</h4>
<p>Huh, good find.</p>



<a name="220454622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220454622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220454622">(Dec 19 2020 at 05:16)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot/near/215672877">said</a>:</p>
<blockquote>
<p><a href="https://github.com/rust-lang/rust/issues/78761#issuecomment-722150923">https://github.com/rust-lang/rust/issues/78761#issuecomment-722150923</a></p>
<p>any ideas how to make this faster? <span class="user-mention silent" data-user-id="119009">eddyb</span> blanket impls are like <code>impl&lt;T&gt; MyTrait for T</code>, right? is there any way to speed that up other than by looking at all traits and impls?</p>
</blockquote>
<p>OMG THIS WAS STARING ME IN THE FACE THE WHOLE TIME <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.trait_impls_of">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.trait_impls_of</a></p>



<a name="220454629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220454629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220454629">(Dec 19 2020 at 05:16)</a>:</h4>
<p>won't finish this tonight but I bet doing this would make it O(n^2) instead of n^3</p>



<a name="220489330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220489330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220489330">(Dec 19 2020 at 22:00)</a>:</h4>
<p>does anyone know how to get in contact with <code>@michaelwoerister</code>? I want to know if it's ok to make <code>TraitImpls::blanket_impls</code> public</p>



<a name="220489831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220489831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220489831">(Dec 19 2020 at 22:13)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot/near/220454629">said</a>:</p>
<blockquote>
<p>won't finish this tonight but I bet doing this would make it O(n^2) instead of n^3</p>
</blockquote>
<p>btw I was wrong, this would make it linear :)</p>



<a name="220490020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220490020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220490020">(Dec 19 2020 at 22:17)</a>:</h4>
<p>it's <span class="user-mention" data-user-id="124287">@mw</span> i think, isn't it?</p>



<a name="220490766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220490766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220490766">(Dec 19 2020 at 22:34)</a>:</h4>
<p>summarizing my thoughts in the meantime: <code>for_each_relevant_impl</code> is the wrong abstraction for rustdoc. I think it's intended for finding if a given impl applies to an item? In that case you'd only call it once, or at least have only a few traits that you consider. But rustdoc wants to find <em>all</em> impls for <em>every</em> trait, which gives it really bad polynomial time:</p>
<div class="codehilite" data-code-language="Python"><pre><span></span><code><span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">crate</span><span class="p">:</span>
  <span class="k">for</span> <span class="n">trait</span> <span class="ow">in</span> <span class="n">all_traits</span><span class="p">():</span>
    <span class="k">for</span> <span class="n">impl</span> <span class="ow">in</span> <span class="n">relevant_impls</span><span class="p">(</span><span class="n">trait</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
      <span class="k">if</span> <span class="nb">all</span> <span class="n">obligations</span> <span class="ow">in</span> <span class="n">impl</span> <span class="n">apply</span> <span class="n">to</span> <span class="n">item</span><span class="p">:</span>
         <span class="c1"># do some things with `Clean`</span>
</code></pre></div>
<p>The <code>for item in crate</code> bit can't be avoided, but it can avoid the triple nested inner loop by only considering the impls that match in the first place:</p>
<div class="codehilite" data-code-language="Python"><pre><span></span><code><span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">crate</span><span class="p">:</span>
  <span class="k">for</span> <span class="n">impl</span> <span class="ow">in</span> <span class="n">blanket_impls</span><span class="p">(</span><span class="n">item</span><span class="p">):</span>
    <span class="c1"># do some things with clean</span>
</code></pre></div>



<a name="220490798"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220490798" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220490798">(Dec 19 2020 at 22:35)</a>:</h4>
<p>in particular, this no longer looks at <code>non_blanket_impls</code> at all, nor tries to simplify the type, and it doesn't require running for each trait</p>



<a name="220490868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220490868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220490868">(Dec 19 2020 at 22:36)</a>:</h4>
<p>although actually I think I'm doing this wrong - the <code>DefId</code> is the id of the <em>trait</em>, not the item</p>



<a name="220490879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220490879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220490879">(Dec 19 2020 at 22:37)</a>:</h4>
<p>so this still has the same complexity :(</p>



<a name="220490896"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220490896" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220490896">(Dec 19 2020 at 22:37)</a>:</h4>
<p>is there some way to look up what blanket impls apply directly?</p>



<a name="220490940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220490940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220490940">(Dec 19 2020 at 22:38)</a>:</h4>
<p>i don't think so</p>



<a name="220490971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220490971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220490971">(Dec 19 2020 at 22:39)</a>:</h4>
<p>ok, is there a way to look up only the impls that apply to a given item?</p>



<a name="220490976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220490976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220490976">(Dec 19 2020 at 22:39)</a>:</h4>
<p>rather than having to go through a random trait first</p>



<a name="220491076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491076">(Dec 19 2020 at 22:41)</a>:</h4>
<p>hmm maybe <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.all_impls">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.all_impls</a></p>



<a name="220491088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491088">(Dec 19 2020 at 22:42)</a>:</h4>
<p>err actually I think I want <a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.all_trait_implementations">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.all_trait_implementations</a></p>



<a name="220491220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491220">(Dec 19 2020 at 22:45)</a>:</h4>
<p>could you walk all trait impls once</p>



<a name="220491222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491222">(Dec 19 2020 at 22:45)</a>:</h4>
<p>sort them into three buckets:</p>



<a name="220491225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491225">(Dec 19 2020 at 22:45)</a>:</h4>
<ul>
<li>applying for all <code>T: ?Sized</code></li>
</ul>



<a name="220491226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491226">(Dec 19 2020 at 22:45)</a>:</h4>
<ul>
<li>applying for <code>T: Sized</code></li>
</ul>



<a name="220491230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491230">(Dec 19 2020 at 22:45)</a>:</h4>
<p>what does Sized have to do with it?</p>



<a name="220491231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491231">(Dec 19 2020 at 22:45)</a>:</h4>
<ul>
<li>applying for <code>T: TraitA + TraitB</code></li>
</ul>



<a name="220491282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491282">(Dec 19 2020 at 22:46)</a>:</h4>
<p><code>Sized</code> is the default, so I expect that to happen the most often and it's easier to check for</p>



<a name="220491289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491289">(Dec 19 2020 at 22:46)</a>:</h4>
<p>what is the bucket for?</p>



<a name="220491293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491293">(Dec 19 2020 at 22:47)</a>:</h4>
<p>so looking a <code>T: Sized</code> separately from <code>T: OtherBounds</code> seems <del>easiest</del>worth it</p>



<a name="220491299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491299">(Dec 19 2020 at 22:47)</a>:</h4>
<p>this has a runtime of <code>O(nTraits)</code></p>



<a name="220491303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491303">(Dec 19 2020 at 22:47)</a>:</h4>
<p>now we know that all traits from the first bucket always apply</p>



<a name="220491309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491309">(Dec 19 2020 at 22:47)</a>:</h4>
<p>from the second bucket if the adt is sized which we only have to check once</p>



<a name="220491360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491360">(Dec 19 2020 at 22:48)</a>:</h4>
<p>and for the third one, which is probably fairly small we actually check if it can apply by using the current system</p>



<a name="220491371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491371">(Dec 19 2020 at 22:48)</a>:</h4>
<p>the idea is to reduce the number of trait we have to check in the first place</p>



<a name="220491378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491378">(Dec 19 2020 at 22:48)</a>:</h4>
<p>ok, that makes sense</p>



<a name="220491381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491381">(Dec 19 2020 at 22:49)</a>:</h4>
<p>yeah, exactly</p>



<a name="220491399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491399">(Dec 19 2020 at 22:49)</a>:</h4>
<p>the hard part I don't know how to do is how to go from</p>
<div class="codehilite"><pre><span></span><code>for item in crate:
  for trait in crate:
</code></pre></div>
<p>to</p>
<div class="codehilite"><pre><span></span><code>for trait in crate:
  for item in crate:
</code></pre></div>



<a name="220491405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491405">(Dec 19 2020 at 22:49)</a>:</h4>
<p>it's not a loop, it's some weird thing with <code>DocFolder</code></p>



<a name="220491450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491450">(Dec 19 2020 at 22:50)</a>:</h4>
<p>plus it gets called for all primitives</p>



<a name="220491456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491456">(Dec 19 2020 at 22:50)</a>:</h4>
<p>so my idea was a new rustdoc exclusive query which computes this</p>



<a name="220491475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491475">(Dec 19 2020 at 22:51)</a>:</h4>
<p>or a function called when creating the <code>DocContext</code> and adding a field to <code>DocContext</code></p>



<a name="220491491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491491">(Dec 19 2020 at 22:51)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot/near/220491299">said</a>:</p>
<blockquote>
<p>this has a runtime of <code>O(nTraitI)</code></p>
</blockquote>
<p>and we only do it once at the start - it's actually O(nTraitImpls)</p>



<a name="220491505"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491505" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491505">(Dec 19 2020 at 22:52)</a>:</h4>
<p>ok, and get rid of DocFolder altogether</p>



<a name="220491532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491532">(Dec 19 2020 at 22:52)</a>:</h4>
<p>at least for this part of rustdoc</p>



<a name="220491540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491540">(Dec 19 2020 at 22:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/247081-t-compiler.2Fperformance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot/near/220491505">said</a>:</p>
<blockquote>
<p>ok, and get rid of DocFolder altogether</p>
</blockquote>
<p>maybe, don't know what it's used for myself</p>



<a name="220491545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491545">(Dec 19 2020 at 22:52)</a>:</h4>
<p>nothing useful lol</p>



<a name="220491550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491550">(Dec 19 2020 at 22:53)</a>:</h4>
<p>mostly just ignoring stripped items</p>



<a name="220491554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491554">(Dec 19 2020 at 22:53)</a>:</h4>
<p>which we could probably check some other way</p>



<a name="220491561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491561">(Dec 19 2020 at 22:53)</a>:</h4>
<p>hmm ok <span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span></p>



<a name="220491566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491566">(Dec 19 2020 at 22:53)</a>:</h4>
<p>does my idea make sense to you?</p>



<a name="220491613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491613">(Dec 19 2020 at 22:54)</a>:</h4>
<p>sort of? the idea is we do this up-front computation, and then instead of looping over all_traits(), we loop over the items in the third bucket?</p>



<a name="220491618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491618">(Dec 19 2020 at 22:54)</a>:</h4>
<p>yeah</p>



<a name="220491639"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491639" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491639">(Dec 19 2020 at 22:55)</a>:</h4>
<p>I'm not sure how to actually do that lol but I can maybe try after dinner</p>



<a name="220491692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220491692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220491692">(Dec 19 2020 at 22:56)</a>:</h4>
<p>seems good, will sleep now. If you need help feel free to ping me</p>



<a name="220676227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220676227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220676227">(Dec 22 2020 at 10:26)</a>:</h4>
<p><span class="user-mention" data-user-id="232545">@Joshua Nelson</span> Hey, did you get your question answered? If not, let me know what information you need from me exactly.</p>



<a name="220692535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220692535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220692535">(Dec 22 2020 at 14:11)</a>:</h4>
<p>well, my question didn't make much sense as written <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="220692561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220692561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220692561">(Dec 22 2020 at 14:11)</a>:</h4>
<p>I didn't realize there's no way to look up an impl without going through a trait first</p>



<a name="220692638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220692638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220692638">(Dec 22 2020 at 14:12)</a>:</h4>
<p>but if you have time my real question is 'can I make the algorithmic complexity of <code>get_blanket_impls</code> simpler?'</p>



<a name="220692656"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220692656" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220692656">(Dec 22 2020 at 14:12)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> suggested one approach that I haven't tried yet</p>



<a name="220793937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/rustdoc%20calls%20%60for_each_relevant_impl%60%20a%20lot/near/220793937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/rustdoc.20calls.20.60for_each_relevant_impl.60.20a.20lot.html#220793937">(Dec 23 2020 at 14:39)</a>:</h4>
<p>Hm, I'm not really the right person to ask about the trait system implementation, I think. Sorry.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>